package com.software.graduationproject.commons.enums;

import com.v2coding.validate.BaseResultCode;

/**
 * ResultCodes : 状态码
 * ---------------------------------------------------------------------------------------------------------------------
 */
public enum ResultCodes implements BaseResultCode {
    SUCCESS(200, "SUCCESS", "操作成功"),
    FAILURE(400, "FAILURE", "操作失败"),
    FAILURE_REQUEST_ERROR(400, "FAILURE_REQUEST_ERROR", "请求错误"),
    FAILURE_REQUEST_NOT_FOUND(404, "FAILURE_REQUEST_NOT_FOUND", "您所请求的地址不存在"),
    FAILURE_REQUEST_EXIPIRED(400, "FAILURE_REQUEST_EXIPIRED", "请求过期"),
    FAILURE_REQUEST_DUPLICATE(400, "FAILURE_REQUEST_DUPLICATE", "请求重复"),
    FAILURE_PARAM_ERROR(400, "FAILURE_PARAM_ERROR", "参数错误"),
    FAILURE_CAPTCHA_ERROR(400, "FAILURE_CAPTCHA_ERROR", "验证码错误"),
    FAILURE_PARAM_SIGNATURE_INVALID(400, "FAILURE_PARAM_SIGNATURE_INVALID", "签名错误"),
    FAILURE_AUTHORIZE_ERROR(401, "FAILURE_AUTHORIZE_ERROR", "权限错误"),
    FAILURE_AUTHORIZE_INVALID(401, "FAILURE_AUTHORIZE_INVALID", "用户名或密码错误"),
    FAILURE_AUTHORIZE_LOGIN(401, "FAILURE_AUTHORIZE_LOGIN", "您还未登录，请先登录"),
    FAILURE_AUTHORIZE_EXPIRED(401, "FAILURE_AUTHORIZE_EXPIRED", "您的账号因在其他地方登录或长时间无操作而失效,请重新登录"),
    FAILURE_AUTHORIZE_DENIED(403, "FAILURE_AUTHORIZE_DENIED", "对不起,您没有权限访问"),
    FAILURE_SERVICE_ERROR(400, "FAILURE_SERVICE_ERROR", "业务错误"),
    FAILURE_SERVICE_DATA_NOT_EXSITS(400, "FAILURE_SERVICE_DATA_NOT_EXSITS", "数据不存在"),
    FAILURE_SERVICE_DATA_ALREADY_EXSITS(400, "FAILURE_SERVICE_DATA_ALREADY_EXSITS", "数据已存在"),
    FAILURE_SERVICE_DATA_CAN_NOT_DELETE(400, "FAILURE_SERVICE_DATA_CAN_NOT_DELETE", "数据禁止删除"),
    FAILURE_SERVER_ERROR(500, "FAILURE_SERVER_ERROR", "服务发生错误,请稍后再试");

    public int status;
    public String code;
    public String message;

    public int getStatus() {
        return this.status;
    }

    public String getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }

    private ResultCodes(final int status, final String code, final String message) {
        this.status = status;
        this.code = code;
        this.message = message;
    }
}
